package application.translators.impl;

import application.model.PhaseModel;
import application.model.PhasesModel;
import application.translators.Translator;
import mappings.Phases;

import java.util.List;

public class PhasesTranslator implements Translator<List<Phases>, PhasesModel>
{
    @Override
    public PhasesModel translate(List<Phases> input)
    {
        PhasesModel phasesModel = new PhasesModel();

        for(Phases phase : input)
        {
            PhaseModel phaseModel = new PhaseModel();

            phaseModel.setId(phase.getId());
            phaseModel.setName(phase.getName());

            phasesModel.addPhase(phaseModel);
        }

        return phasesModel;
    }
}
